home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
MACUNZIP
/
MACUNZIP.C
< prev
next >
Wrap
Text File
|
1991-08-17
|
2KB
|
60 lines
/* UnZip for the Macintosh */
/* */
/* John Eng July 1991 */
/* */
/* Based on the TURBO C Version 2.0.1 for the IBM by Samuel H. */
/* Smith as modified by George M. Sipe for "portability" to UNIX, */
/* Microsoft C for the IBM, and other machines. */
/* */
/* This file contains code to compensate for non-portability of */
/* the main source code. Please see comments in the main source */
/* file for further information. */
/* utime() and *memcpy() are not always found in UNIX libraries. */
/* *memcpy() is defined here. A version of utime() could probably */
/* be written to work on the Macintosh, but is omitted here. */
/* MacInit() is defined here to provide UNIX-style command line */
/* arguments, which are not part of the typical Macintosh user */
/* interface. */
int utime(f, t)
char *f;
struct utimbuf *t;
{
}
void *memcpy(s, ct, n)
unsigned char *s, *ct;
register int n;
{
register unsigned char *s1, *s2;
s1 = s;
s2 = ct;
while (n > 0) {
*s1++ = *s2++;
n--;
}
}
void MacInit(c, v)
int *c;
char **v;
{
static char fname[80];
MaxApplZone();
prefix_of = (int *) malloc((hsize+1)*sizeof(int));
suffix_of = (byte *) malloc((hsize+1)*sizeof(byte));
stack = (byte *) malloc((hsize+1)*sizeof(byte));
printf("\fUnZip for the Apple Macintosh (John Eng)\n\n");
printf("This program is based on C source code written by Samuel H.");
printf(" Smith\nand George M. Sipe.\n\n");
printf("Filename? ");
gets(fname);
if (strlen(fname) > 0) {
v[1] = fname;
*c = 2;
}
else exit(0);
}